package com.shazhu.nongjt.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.shazhu.common.annotation.Excel;
import com.shazhu.common.core.domain.BaseEntity;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;

/**
 * 打印机认证记录对象 njt_printer_auth
 * 
 * @author shazhu
 * @date 2025-09-29
 */
public class NjtPrinterAuth extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 认证记录ID */
    private Long authId;

    /** 打印机序列号 */
    @Excel(name = "打印机序列号")
    @NotBlank(message = "打印机序列号不能为空")
    private String serialNumber;

    /** 认证状态（0成功 1失败） */
    @Excel(name = "认证状态", readConverterExp = "0=成功,1=失败")
    @Pattern(regexp = "0|1", message = "认证状态只能为0或1")
    private String authStatus;

    /** 认证时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "认证时间", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "认证时间不能为空")
    private Date authTime;

    /** 认证IP地址 */
    @Excel(name = "认证IP地址")
    @Pattern(regexp = "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", message = "IP地址格式不正确")
    private String ipAddress;

    /** MAC地址 */
    @Excel(name = "MAC地址")
    @Pattern(regexp = "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$", message = "MAC地址格式不正确")
    private String macAddress;

    /** 认证结果 */
    @Excel(name = "认证结果")
    @NotBlank(message = "认证结果不能为空")
    private String authResult;

    public void setAuthId(Long authId) 
    {
        this.authId = authId;
    }

    public Long getAuthId() 
    {
        return authId;
    }

    public void setSerialNumber(String serialNumber) 
    {
        this.serialNumber = serialNumber;
    }

    public String getSerialNumber() 
    {
        return serialNumber;
    }

    public void setAuthStatus(String authStatus) 
    {
        this.authStatus = authStatus;
    }

    public String getAuthStatus() 
    {
        return authStatus;
    }

    public void setAuthTime(Date authTime) 
    {
        this.authTime = authTime;
    }

    public Date getAuthTime() 
    {
        return authTime;
    }

    public void setIpAddress(String ipAddress) 
    {
        this.ipAddress = ipAddress;
    }

    public String getIpAddress() 
    {
        return ipAddress;
    }

    public void setMacAddress(String macAddress) 
    {
        this.macAddress = macAddress;
    }

    public String getMacAddress() 
    {
        return macAddress;
    }

    public void setAuthResult(String authResult) 
    {
        this.authResult = authResult;
    }

    public String getAuthResult() 
    {
        return authResult;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("authId", getAuthId())
            .append("serialNumber", getSerialNumber())
            .append("authStatus", getAuthStatus())
            .append("authTime", getAuthTime())
            .append("ipAddress", getIpAddress())
            .append("macAddress", getMacAddress())
            .append("authResult", getAuthResult())
            .append("remark", getRemark())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}